require(["config"], function(config) {
	require(["jquery.ui", "com", "jquery", "zepto", "sw", "toast"], function(jqui, com, jq, zep, sw, t) {
		if(jq("#likes").click){
				jq("#zhsj").val(com.getCookie("newusername"));
				jq("#paswd").val(com.getCookie("newpassword"));
				}
		jq(document).ready(function(){;
         var random_bg=Math.floor(Math.random()*4+1);
         var bg='url(imag/bj/bj'+random_bg+'.jpg)';
//       console.log(bg);
         jq("#dlner").css("background",bg);  
		})
		
		jq("#ptdlz").click(function(){
			jq("#sjdlz").removeClass("xuzhong");
			jq("#ptdlz").addClass("xuzhong");			
			jq("#ptdl").css("display","block");
			jq("#cellpdl").css("display","none");			
		})
		jq("#sjdlz").click(function(){
			jq("#ptdlz").removeClass("xuzhong");
			jq("#sjdlz").addClass("xuzhong");			
			jq("#cellpdl").css("display","block");
			jq("#ptdl").css("display","none");
			jq("#txt").html(com.yzm());
		})	
		jq("#tj").click(function(){
			if(jq("#ptdlz").click){
				var yanzh=com.getCookie("username");
				var yanmm=com.getCookie("password");
				var yhm =jq("#zhsj").val();
				var pasinput=jq("#paswd").val();
				console.log(yhm,pasinput)
				console.log(yanzh,yanmm)
				if((yhm=yanzh)&&(pasinput==yanmm)){
				window.location.href="http://127.0.0.1/qebody/syner.html";
				if(jq("#likes").click){
					com.setCookie("newusername", yhm, 10);
					com.setCookie("newpassword",pasinput, 10);
				}
					
				}else{
					alert("帐号或密码错误")
				}
			}
			
		})								
	})
})